home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Graphics Plus
/
Graphics Plus.iso
/
general
/
viewers
/
polyview
/
polyvw31.lha
/
Polyview3.1
/
new
/
pvhelp.c
< prev
next >
Wrap
C/C++ Source or Header
|
1993-08-13
|
5KB
|
127 lines
/*****************************************************************************
* NCSA Polyview 3.1 *
* *
* Version 3.1 changes and additions by Gilles Bourhis. *
* Version 3 changes and additions by Marc Andreessen. *
* Version 2 by Brian Calvert. *
* *
* Software Development Group *
* National Center for Supercomputing Applications *
* University of Illinois at Urbana-Champaign *
* *
* This is BETA release software. As such it may contain software bugs and *
* exhibit inconsistencies. *
* *
* Please send bug reports to polyview@ncsa.uiuc.edu. *
* *
* Copyright (c) 1992 The Board of Trustees of the University of Illinois. *
* *
* Permission to use, copy, and modify this software and its *
* documentation for educational, research, and non-profit purposes is *
* hereby granted, provided that the above copyright notice, the original *
* authors names, and this permission notice appear in all such copies. *
* Any distribution of this software requires the explicit and written *
* authorization of the authors. *
* *
* The University of Illinois makes no representations about the *
* suitability of this software for any purpose. It is provided "as is" *
* without warranty of any kind. *
*****************************************************************************/
/* $Id: pvhelp.c,v 1.2 93/08/13 14:21:21 gbourhis Exp $ */
#ifdef RCSLOG
$Log: pvhelp.c,v $
* Revision 1.2 93/08/13 14:21:21 gbourhis
* Change Version number.
*
* Revision 1.1 92/09/18 10:55:26 marca
* Initial revision
*
#endif
#include "pv.h"
#include "pvtokens.h"
#include "pvhelp.h"
/* We consider the help subsystem to be localized here. There is only
one help window, and it is filled and managed as required. */
static Widget help_base = NULL;
static Widget help_text;
/* ----------------------------- GUIpostHelp ------------------------------ */
/* This function creates the help screen if it doesn't already exist. */
static void GUIpostHelp (char *text, char *title)
{
/* If it's never been created, create it. */
if (help_base == NULL)
help_base = XmxMakeHelpTextDialog
(gstate->base, (String)NULL, (String)NULL, &help_text);
/* Set the text and title. */
XmxTextSetString (help_text, text);
XmxAdjustDialogTitle (help_base, title);
/* Manage (or remanage) the dialog. */
XmxManageRemanage (help_base);
return;
}
static char *commandstr = NULL;
static void do_help_on_commands (void)
{
parse_t *p;
if (commandstr == NULL)
{
commandstr = (char *)malloc (sizeof (char) * 10000);
commandstr[0] = '\0';
strcat (commandstr, oncommands_txt);
for (p = gstate->parse_table; p->format[0] != '\0'; p++)
{
strcat (commandstr, "--> ");
strcat (commandstr, p->format);
strcat (commandstr, "\n");
}
}
GUIpostHelp (commandstr, "About Polyview 3.1 Commands");
return;
}
/* ------------------------------ GUIdoHelp ------------------------------- */
void GUIdoHelp (int help_token)
{
switch (help_token)
{
case PV_HELP_ABOUT:
GUIpostHelp (about_txt, "About NCSA Polyview 3.1");
break;
case PV_HELP_ONCOMMANDS:
do_help_on_commands ();
break;
case PV_MAIN_HELP_ONWINDOW:
GUIpostHelp (main_txt, "Polyview 3.1: Help On Main Window");
break;
case PV_PVIEW_HELP_ONWINDOW:
GUIpostHelp (pview_txt, "Polyview 3.1: Help on Polyview Window");
break;
case PV_PALETTE_HELP_ONWINDOW:
GUIpostHelp (pal_txt, "Polyview 3.1: Help on Palette Window");
break;
case PV_INFO_BUTTON_HELP:
GUIpostHelp (info_txt, "Polyview 3.1: Help on Info Window");
break;
case PV_TIME_BUTTON_HELP:
GUIpostHelp (time_txt, "Polyview 3.1: Help on Time Window");
break;
}
}